<template>
	<view class="unquality-assess-item">
		<view class="top-box">
			<text>是否合格</text>
			<van-switch @change="onChange" :checked="checked" size="24px" />
		</view>
		<view class="desc">问题描述：
			<input @input="onInput" type="text" placeholder="请输入问题描述">
		</view>
		<view class="img-content">
			<upload @input="onUpload"  :boxWidth="180"></upload>
		</view>
	</view>
</template>

<script>
	import VanSwitch from '@/wxcomponents/vant/dist/switch'
	import upload from '@/components/upload.vue'
	export default {
		components: {
			upload,
			VanSwitch
		},
		props:{
			inspect: {
				type: Object
			}
		},
		data() {
			return {
				checked: false
			};
		},
		methods: {
			onChange(event) {
				this.checked = event.detail
				this.$emit('change', this.checked)
			},
			onUpload(e) {
				this.$emit('upload', e)
			},
			onInput(e) {
				this.$emit('input', e.target.value)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.unquality-assess-item {
		width: 700rpx;
		height: 360rpx;
		padding: 20rpx;
		border: 2rpx solid #B5B5B5;
		margin-bottom: 20rpx;
		.top-box {
			display: flex;
			justify-content: space-between;
		}
		.desc {
			margin-bottom: 20rpx;
			display: flex;
			input {
				width: 450rpx;
			}
		}
		.img-content {
			display: flex;
			margin-left: -20rpx;
			.img-item {
				width: 140rpx;
				height: 140rpx;
				margin: 10rpx;
				.img {
					width: 100%;
					height: 100%;
				}
			}
		}
	}
</style>
